/*
 * @Author: Yhd you@example.com
 * @Date: 2023-03-14 19:47:59
 * @LastEditors: Yhd you@example.com
 * @LastEditTime: 2023-03-14 20:44:22
 * @FilePath: \electron\window.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const {
    BrowserWindow
} = require("electron");
const path = require("path");

function createWindow() {
    const win = new BrowserWindow({
        width: 800,
        height: 600,
        webPreferences: {
            preload: path.join(__dirname, "preload.js"),
            // nodeIntegration: true, //预加载脚本与主线程隔离
            contextIsolation: false, // 预加载脚本与渲染脚本隔离
        }
    })
    win.loadURL('https://www.douyin.com/')
    // win.webContents.toggleDevTools();
    return win;
}

module.exports = {
    createWindow
}